layout(location=0) in vec4 in_posrot;
//in vec4 color;
layout(location=1) in vec4 in_sizealpha;
layout(location=2) in vec4 in_color;
layout(location=3) in vec2 in_uv;

out vec2 out_uv;
out vec4 out_color;

void main()
{
	vec2 size=in_sizealpha.xy*(in_uv.xy-vec2(0.5,0.5));
	vec3 pos=(world_mtx*vec4(in_posrot.xyz,1)).xyz;
	
	vec2 rot=vec2(cos(-in_posrot.w), sin(-in_posrot.w));

	vec2 quad;
	quad.x=rot.x*size.x+rot.y*size.y;
	quad.y=rot.x*size.y-rot.y*size.x;
	
	gl_Position=viewproj_mtx*(float4((cam_mtx*vec4(quad,0,0)).xyz+pos, 1));

	out_color=in_color*in_sizealpha.z;
	out_uv=in_uv;
}